unit Main;
//YXC_2012_06_08_20_41_46
//kazarus.dbengine.
{
    UniConnection1.Server:='60.191.73.107:1521:JGCZCS';
    UniConnection1.SpecificOptions.Clear;
    UniConnection1.SpecificOptions.Add('Oracle.Direct=True');
}

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, DB, DBAccess, Uni, UniProvider, SQLServerUniProvider,
  OracleUniProvider, Grids, DBGrids, RzDBGrid, ExtCtrls, RzPanel, MemDS,
  RzButton, RzTabs, BaseGrid, AdvGrid,Class_Memb;

type
  TForm1 = class(TForm)
    SQLServerUniProvider1: TSQLServerUniProvider;
    UniConnection1: TUniConnection;
    OracleUniProvider1: TOracleUniProvider;
    RzToolbar1: TRzToolbar;
    UniDataSource1: TUniDataSource;
    UniQuery1: TUniQuery;
    Btnx_1: TRzToolButton;
    UniSQL1: TUniSQL;
    RzPageControl1: TRzPageControl;
    TabSheet1: TRzTabSheet;
    TabSheet2: TRzTabSheet;
    RzDBGrid1: TRzDBGrid;
    AdvGrid1: TAdvStringGrid;
    Btnx_2: TRzToolButton;
    Btnx_3: TRzToolButton;
    Btnx_4: TRzToolButton;
    Btnx_5: TRzToolButton;
    procedure Btnx_1Click(Sender: TObject);
    procedure Btnx_2Click(Sender: TObject);
    procedure Btnx_3Click(Sender: TObject);
    procedure Btnx_4Click(Sender: TObject);
    procedure Btnx_5Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

uses
  UniEngine;


{$R *.dfm}

procedure TForm1.Btnx_1Click(Sender: TObject);
begin
  UniQuery1.Active:=True;
end;

procedure TForm1.Btnx_2Click(Sender: TObject);
{var
  StrsA:TStringList;}
begin
  {StrsA:=nil;
  StrsA:=Tmemb.StrsDB('select * from tbl_card',UniConnection1);
  if (StrsA=nil) or (StrsA.Count=0) then Exit;

  ShowMessageFmt('%D',[StrsA.Count]);
  ShowMessage(StrsA.Text);}
  
end;

procedure TForm1.Btnx_3Click(Sender: TObject);
begin
  //
  if TUniEngine.ExistTable('TBL_CARD_EX',UniConnection1) then
  begin
    ShowMessage('exist');
  end else
  begin
    ShowMessage('not exist');
  end;
end;

procedure TForm1.Btnx_4Click(Sender: TObject);
begin
  if TUniEngine.ExistField('tbl_card','card_idex',UniConnection1) then
  begin
    ShowMessage('exist');
  end else
  begin
    ShowMessage('not exist');
  end;
end;

procedure TForm1.Btnx_5Click(Sender: TObject);
var
  NumbA:Integer;
begin
  NumbA:=TMemb.CheckField('CARD_IDEX','TBL_CARD',[],UniConnection1);
  ShowMessageFmt('%D',[NumbA]);
end;

end.
